home *** CD-ROM | disk | FTP | other *** search
/ An Introduction to Progr…l Basic 6.0 (4th Edition) / An Introduction to Programming using Visual Basic 6.0.iso / PROGRAMS / CH6 / 6-1-3.FRM (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1998-09-18  |  2.4 KB  |  80 lines

  1. VERSION 5.00
  2. Begin VB.Form frm6_1_3 
  3.    Caption         =   "Read File"
  4.    ClientHeight    =   2595
  5.    ClientLeft      =   1095
  6.    ClientTop       =   1590
  7.    ClientWidth     =   3495
  8.    BeginProperty Font 
  9.       Name            =   "MS Sans Serif"
  10.       Size            =   8.25
  11.       Charset         =   0
  12.       Weight          =   700
  13.       Underline       =   0   'False
  14.       Italic          =   0   'False
  15.       Strikethrough   =   0   'False
  16.    EndProperty
  17.    LinkTopic       =   "Form1"
  18.    PaletteMode     =   1  'UseZOrder
  19.    ScaleHeight     =   2595
  20.    ScaleWidth      =   3495
  21.    Begin VB.PictureBox picItem 
  22.       Height          =   375
  23.       Left            =   120
  24.       ScaleHeight     =   315
  25.       ScaleWidth      =   3195
  26.       TabIndex        =   3
  27.       Top             =   2040
  28.       Width           =   3255
  29.    End
  30.    Begin VB.CommandButton cmdDisplay 
  31.       Caption         =   "Display First Item of File"
  32.       Default         =   -1  'True
  33.       Height          =   495
  34.       Left            =   120
  35.       TabIndex        =   2
  36.       Top             =   1320
  37.       Width           =   3255
  38.    End
  39.    Begin VB.TextBox txtName 
  40.       Height          =   285
  41.       Left            =   1440
  42.       TabIndex        =   1
  43.       Top             =   840
  44.       Width           =   1935
  45.    End
  46.    Begin VB.Label lblFiles 
  47.       Caption         =   "The available files are: HUMOR.TXT, INSULTS.TXT, and SECRET.TXT."
  48.       Height          =   375
  49.       Left            =   120
  50.       TabIndex        =   4
  51.       Top             =   120
  52.       Width           =   3255
  53.    End
  54.    Begin VB.Label lblName 
  55.       Caption         =   "Name of file to open"
  56.       Height          =   495
  57.       Left            =   120
  58.       TabIndex        =   0
  59.       Top             =   720
  60.       Width           =   1215
  61.    End
  62. Attribute VB_Name = "frm6_1_3"
  63. Attribute VB_GlobalNameSpace = False
  64. Attribute VB_Creatable = False
  65. Attribute VB_PredeclaredId = True
  66. Attribute VB_Exposed = False
  67. Private Sub cmdDisplay_Click()
  68.   Dim passWord As String, info As String
  69.   If UCase(txtName.Text) = "SECRET.TXT" Then
  70.       Do
  71.         passWord = UCase(InputBox("What is the password?"))
  72.       Loop Until passWord = "SHAZAM"
  73.   End If
  74.   Open App.Path & "\" & txtName.Text For Input As #1
  75.   Input #1, info
  76.   picItem.Cls
  77.   picItem.Print info
  78.   Close #1
  79. End Sub
  80.